import request from '@/utils/request'
//流程API
export function flowApiSubmit(data) { //提交审核 - 用户
    return request({
        method: 'post',
        url: '/flowApi/submit',
        data
    })
}

export function flowApiComplete(data) { //提交审核 - 管理员审核
    return request({
        method: 'post',
        url: '/flowApi/complete',
        data
    })
}

//运作中的流程接口
export function flowRunTaskQuery(data) {
    return request({
        method: 'get',
        url: '/flowApi/queryRunTask',
        params: data
    })
}

export function flowRunTaskQueryById(id) { //查询一条运作中的流程信息
    return request({
        method: 'get',
        url: '/flowRunTask/query/' + id,
    })
}

//流程实例接口
export function flowInstanceQuery(data) {
    return request({
        method: 'get',
        url: '/flowInstance/query',
        params: data
    })
}

//历史流程接口
export function flowHisTaskQuery(data) {
    return request({
        method: 'get',
        url: '/flowApi/queryHisTask',
        params: data
    })
}

//查询流程状态
export function flowApiQueryInstanceList(data) {
    return request({
        method: 'get',
        url: '/flowApi/queryInstanceList',
        params: data
    })
}

//查询当前流程的状态
export function flowApiQueryCurrentFlowInfo(data) {
    return request({
        method: 'post',
        url: '/flowApi/queryCurrentFlowInfo',
        data
    })
}

//取回（元素库创建人取回）
export function flowApiTakeBack(data) {
    return request({
        method: 'post',
        url: '/flowApi/takeBack',
        data
    })
}

//取回(审核驳回)
export function flowApiTakeBack2(data) {
    return request({
        method: 'post',
        url: '/flowApi/takeBack2',
        data
    })
}